import { createApp } from 'vue'
import App from './APP.vue'
import router from './router'
import './styles/style.css'
import * as echarts from 'echarts'
import ElementPlus from 'element-plus'
import { ElMessageBox } from 'element-plus'
import 'element-plus/dist/index.css'

const app = createApp(App)
app.config.globalProperties.$echarts = echarts
app.use(router)
app.use(ElementPlus)
app.mount('#app')

window.alert = (message) => {
  try {
    ElMessageBox.alert(String(message), '提示', { confirmButtonText: '确定' })
  } catch (e) {
    window.__native_alert__ ? window.__native_alert__(String(message)) : Function('return alert').call(null, String(message))
  }
}

if (!window.__native_alert__) {
  window.__native_alert__ = Function('return alert').call(null)
}
